﻿// <copyright file="JointExtensions.cs" company="Ucaya">
// </copyright>
// <author>Ucaya</author>

namespace KinectExtensions
{
    #region

    using System;

    using Microsoft.Research.Kinect.Nui;

    #endregion

    /// <summary>
    ///   TODO: Update summary.
    /// </summary>
    public static class JointExtensions
    {
        #region Public Methods

        /// <summary>
        ///   The move.
        /// </summary>
        /// <param name = "joint">
        ///   The joint.
        /// </param>
        /// <param name = "movex">
        ///   The movex.
        /// </param>
        /// <param name = "movey">
        ///   The movey.
        /// </param>
        /// <returns>
        /// </returns>
        public static Joint Move(this Joint joint, Func<float, float> movex, Func<float, float> movey)
        {
            var v = new Vector { W = joint.Position.W, X = movex(joint.Position.X), Y = movey(joint.Position.Y), Z = joint.Position.Z };

            return new Joint { ID = joint.ID, Position = v, TrackingState = joint.TrackingState };
        }

        #endregion
    }
}